package editor.modelo;

import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.List;


public class Space {

	public static  enum Tipo { floor 
		{public String toString(){return "floor";}},
		corridor
		{ public String toString(){return "corridor";}},
		office
		{ public String toString(){return "office";}},
		classroom
		{ public String toString(){return "classroom";}},
		stair
		{ public String toString(){return "stair";}}
	}

	protected Point2D centro;
	protected List<Point2D> borde;
	protected String name;
	protected Tipo tipo;
	protected String nombrePadre;
	protected Integer height;
	
	public Integer getHeight() {
		return height;
	}
	public void setHeight(Integer height) {
		this.height = height;
	}
	public void setNombrePadreCompleto(String nombre){
		this.nombrePadre = nombre;
	}
	public String getNombreCompleto(){
		return nombrePadre +"/"+ name;
	}

	public Space() {
		borde = new ArrayList<Point2D>();
		this.height= 0;
	}

	public Point2D getCentro() {
		return centro;
	}

	public void setCentro(Point2D.Float centro) {
		this.centro = centro;
	}

	public void setCentro(float x, float y) {
		this.centro = new Point2D.Float(x, y);
	
	}

	public List<Point2D> getBorde() {
		return borde;
	}

	public String getName() {

		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Tipo getTipo() {
		return tipo;
	}

	public void setTipo(Tipo tipo) {
		this.tipo = tipo;
	}
	
	public Point2D getNextPoint(Point2D pto){
		int i = borde.indexOf(pto);
		if(i>= 0) return borde.get((i+1) % borde.size());
		else return null;
	}

}